package com.ebt.m.proposal_v2.widget.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.ebt.m.R;
import com.ebt.m.proposal_v2.widget.base.CompatLinearLayout;

import butterknife.BindView;

/**
 * 计划书文本提示
 *
 * @author archer.qi
 *         Created on 2017/6/2.
 */
public class ProposalHelper extends CompatLinearLayout {

    @BindView(R.id.helper_content)
    TextView mTvContent;
    @BindView(R.id.helper_delete)
    ImageView mIvDelete;
    @BindView(R.id.helper_direct)
    ImageView mIvDirect;

    private String mContentText;

    public ProposalHelper(Context context) {
        super(context);
    }

    public ProposalHelper(Context context, AttributeSet attrs) {
        super(context, attrs);
    }


    @Override
    protected int setContentView() {
        return R.layout.view_help;
    }

    @Override
    protected void onBindView() {

    }

    public void setMessage(String msg) {
        mContentText = msg;
        mTvContent.setText(msg);
    }

    public void setDirectRightMargin(int rightMargin) {
        LinearLayout.LayoutParams p = (LayoutParams) mIvDirect.getLayoutParams();
        p.rightMargin = rightMargin;
        mIvDirect.setLayoutParams(p);
    }

    public void onDeleteListener(OnClickListener listener) {
        mIvDelete.setOnClickListener(listener);
    }
}
